package com.hongmeng.operater.service.operaterUser.impl;

import com.hongmeng.common.utils.DateUtils;
import com.hongmeng.operater.domain.operaterUser.HmDoctor;
import com.hongmeng.operater.mapper.operaterUser.HmDoctorMapper;
import com.hongmeng.operater.service.operaterUser.IHmDoctorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 医生信息Service业务层处理
 * 
 * @author hongmeng
 * @date 2021-03-02
 */
@Service
public class HmDoctorServiceImpl implements IHmDoctorService
{
    @Autowired
    private HmDoctorMapper hmDoctorMapper;

    /**
     * 查询医生信息
     * 
     * @param id 医生信息ID
     * @return 医生信息
     */
    @Override
    public HmDoctor selectHmDoctorById(Integer id)
    {
        return hmDoctorMapper.selectHmDoctorById(id);
    }

    /**
     * 查询医生信息列表
     * 
     * @param hmDoctor 医生信息
     * @return 医生信息
     */
    @Override
    public List<HmDoctor> selectHmDoctorList(HmDoctor hmDoctor)
    {
        return hmDoctorMapper.selectHmDoctorList(hmDoctor);
    }

    /**
     * 新增医生信息
     * 
     * @param hmDoctor 医生信息
     * @return 结果
     */
    @Override
    public int insertHmDoctor(HmDoctor hmDoctor)
    {
        hmDoctor.setCreateTime(DateUtils.getNowDate());
        return hmDoctorMapper.insertHmDoctor(hmDoctor);
    }

    /**
     * 修改医生信息
     * 
     * @param hmDoctor 医生信息
     * @return 结果
     */
    @Override
    public int updateHmDoctor(HmDoctor hmDoctor)
    {
        hmDoctor.setUpdateTime(DateUtils.getNowDate());
        return hmDoctorMapper.updateHmDoctor(hmDoctor);
    }

    /**
     * 批量删除医生信息
     * 
     * @param ids 需要删除的医生信息ID
     * @return 结果
     */
    @Override
    public int deleteHmDoctorByIds(Integer[] ids)
    {
        return hmDoctorMapper.deleteHmDoctorByIds(ids);
    }

    /**
     * 删除医生信息信息
     * 
     * @param id 医生信息ID
     * @return 结果
     */
    @Override
    public int deleteHmDoctorById(Integer id)
    {
        return hmDoctorMapper.deleteHmDoctorById(id);
    }
}
